// Includes
#include "ILightSource.h"

namespace EraAstral
{
	namespace graphics
	{
		// ILightSource interface base constructor
		ILightSource::ILightSource(core::SceneManager *sceneManager)
		{
			// Allocate memory for color
			m_color = new Color4f();		
		
			m_smgr = sceneManager;
			m_enabled = true;
		}
		
		// ILightSource interface virtual base destructor
		ILightSource::~ILightSource()
		{
			// Free memory taken by color
			delete m_color;
		}
		
		// Gets the type of the light source
		LightSourceType ILightSource::GetType() const
		{
			return m_type;
		}
		
		// Gets the OpenGL light enum of the light source
		GLenum ILightSource::GetGLLightEnum()
		{
			return m_glLight;
		}
		
		// Gets the color of the light source
		Color4f *ILightSource::GetColor() const
		{
			return m_color;
		}
		
		// Sets the color of the light source
		void ILightSource::SetColor(const Color4f& color)
		{
			m_color->Set(color);
		}
		
		// Gets a boolean value indicating if the light source is enabled
		bool ILightSource::IsEnabled() const
		{
			return m_enabled;
		}
		
		// Sets the value determining if the light source is enabled
		void ILightSource::SetEnabled(bool value)
		{
			m_enabled = value;
		}
	}
}